class Seiso::ImportMaster
  class Importers::StatusTypeImporter < Importers::BaseImporter

    def initialize(api, rest_util, resolver)
      self.api = api
      self.rest_util = rest_util
      self.mapper = Mappers::StatusTypeMapper.new resolver
      self.repo_resource = api.statusTypes.get

      @search_resource = repo_resource.search.get
    end

    def import(doc)
      import_items(doc['items'], {})
    end

    def to_search_params(doc_st, context)
      { 'key' => doc_st['key'] }
    end

    def find_resource(search_params)
      @search_resource.findByKey(key: search_params['key']).get
    end
  end
end
